
#ifndef	__COMMON_H
#define	__COMMON_H

 #ifdef SK_COMMON_C_
	#define INTERFACE
#else
	#define INTERFACE extern
#endif
//============time flag==================
sbit DATA_PIN=P0^4;
sbit SOUND_CONTROL=P0^0;
typedef enum
{
    PWM_CHANNEL0,
    PWM_CHANNEL1,
    PWM_CHANNEL2,
    PWM_CHANNEL3,
} E_PWMCNL_SEL;
INTERFACE BIT sk_1ms_flag;
INTERFACE BIT sk_5ms_flag;
INTERFACE BIT sk_10ms_flag;
INTERFACE BIT sk_50ms_flag;
INTERFACE BIT sk_500ms_flag;
INTERFACE BIT sk_1s_flag;
INTERFACE UINT8 check_state;//
void  InitialUART0_Timer1(UINT32 u32Baudrate);
void  Send_Data_To_PC (UINT8 c);
UINT8 Receive_Data_From_PC(void);

INTERFACE void Function_1sProcess(void);
INTERFACE void Function_500msProcess(void);
INTERFACE void Function_50msProcess(void);
INTERFACE void Function_10msProcess(void);
INTERFACE void Function_1msProcess(void);

INTERFACE void KEY_CHECK(void);
INTERFACE void Enabled_Brake_Function(void);
INTERFACE void init_pwm_all(void);
INTERFACE void set_PWM_val(UINT16 PWM_VAL);
INTERFACE void PWM_Channel(E_PWMCNL_SEL Channel);
INTERFACE void  Init_PWM();  
INTERFACE void init_state(void);
INTERFACE void setBeeTime(UINT16 time);

void save_config();


enum work_state{
stop=0,
smart_wait,	//����ģʽ
wait,  //�ȴ�5����Զ���ʼ
befor_coding,
moto_work,
moto_stop,
warning   //��֪ģʽ
};

INTERFACE UINT16 u16ADC;
INTERFACE UINT16 now_temp; //????,???? 
INTERFACE UINT16 now_hum;
INTERFACE UINT16 distance;
INTERFACE UINT16 SHOW_TIME;//????
INTERFACE UINT8 SET_TIME;//????
INTERFACE BIT HEIGHT_TEM_LED ;   //??led
INTERFACE BIT TEMP_LED ;   //??led
INTERFACE BIT POWER;    //??led
INTERFACE BIT SHOW_FALG;   //??????
INTERFACE BIT WORKING;   //????
INTERFACE BIT MOTO_PAUSE;   //????,????,???????,????
INTERFACE UINT8 MODE_INDEX;//??  ?????? 0 ?? 
INTERFACE UINT8 STRONG_INDEX;//???? ??????  ????0 
INTERFACE UINT8 SHOW_MODE;//??????   0 ????  1??  2 ??
#define BEFOR_TIME 300;
#define END_TIME 30;//
#define WAIT_TIME 5;
#define MAX_STRONG 5;//????
#define MAX_MODE 5;//??????
//=========================time process end ===============================
typedef struct 
{
       UINT16 target_temp_min;
	     UINT16 target_temp;
       UINT16 COMPRESSOR_BEFOR_TIME;
}config;

INTERFACE config myconfig;

#undef   INTERFACE

#endif 
